/* Copyright [2023] <gyl> */
#pragma once

#include <vector>

#include "sql/operator/logical_operator.h"

/**
 * @brief 逻辑算子，用于执行update语句
 * @ingroup LogicalOperator
 */
class UpdateLogicalOperator : public LogicalOperator {
 public:
  UpdateLogicalOperator(Table *table, std::vector<UpdateUnit> update_units);
  virtual ~UpdateLogicalOperator() = default;

  LogicalOperatorType type() const override {
    return LogicalOperatorType::UPDATE;
  }
  Table *table() const { return table_; }

  std::vector<UpdateUnit> &update_units() { return update_units_; }

 private:
  Table *table_ = nullptr;
  std::vector<UpdateUnit> update_units_;
};
